<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<style type="text/css">
    .select_model{
        -moz-appearance: none;background: rgba(0, 0, 0, 0) url("{:get_style_cdnurl()}paimai/yunying/images/sanjiao.jpg") no-repeat scroll 115px 5px;
        border: 1px solid #d7d7d7;
        float: left;height: 26px;line-height: 26px;margin-right: 8px;text-indent: 2px;width: 136px;}
</style>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar"  menu="cwgl.czbc" />
    <div class="mianR">
        <div class="yuyue">
            <ul>
                <li onclick="get_list(1)" class="yuCurrent">待处理</li>
                <li onclick="get_list(2)">已处理</li>
            </ul>
        </div>

        <div class="yuList">
            <div class="yuSuo clearfix" style="float:left;">
                <input id="status" name="status" type="hidden" value="{$params.status}"/>

                <select name="location_area" id="location_area" class="select_model">
                    <if condition="count($bc_city) gt 1">
                        <option value="0">请选择所在地</option>
                    </if>
                    <volist name="bc_city" id="city">
                        <option value="{$key}">{$city}</option>
                    </volist>
                </select>
                <input type="text" id="keywords" name="keywords" value="{$params.keywords}"  placeholder="车主联系人/车主电话/拍卖单号"  class="suoDian suoDian1">
                <input type="button" id="search" value="搜索" class="suoSou">
            </div>

            <div class="listBox" id="listBox">

            </div>
        </div>
    </div>
    <div class="clear"></div>
    <include file="Public/foot" />

    <script type="text/javascript">

        function get_page(p){
            var status = $("#status").val();
            var url = get_url();
            url += "&p=" + p;
            $.get("/CarOwnerCompensate/compensate_list?status=" + status, encodeURI(url), function(data){
                $("#listBox").html(data);
            },"html");
        }
        get_list(1);
        function get_list(status){
            change_tabs(status);
            $("#status").val(status);
            var url = get_url();
            $.get("/CarOwnerCompensate/compensate_list?status=" + status ,url,function(data){
                $("#listBox").html(data);
            },"html");
        }

        function get_url(){
            var url = "";
            var location_area = $("#location_area").val();
            var keywords = $("#keywords").val();
            if (location_area > 0) {
                url += '&location_area=' + location_area;
            }
            if (keywords) {
                url += '&keywords=' + keywords;
            }
            return url;
        }

        $('#search').on('click',function(){
            var status = $("#status").val();
            get_list(status);
            // clear_params();
        });

        function change_tabs(status){
            if($("#status").val() != status){
                clear_form_params();
            }
        }
        function clear_form_params(){
            $(':input')
                    .not(':button, :submit, :reset, :hidden, select')
                    .val('');
            if($("#location_area option").length > 1){
                $("#location_area").val(0);
            }
        }
    </script>